<template>
  <el-container style="height: auto; border: 0px solid #eee">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-menu  router>
        <el-submenu  index="1"  >
          <template slot="title"><i class="el-icon-folder" >我的文件</i></template>

            <el-menu-item  index="/DirMain"><i class="el-icon-folder-opened" >文件列表</i></el-menu-item>
          <el-menu-item index="/ShareFiles"><i class="el-icon-share">我的共享</i></el-menu-item>
          <el-menu-item index="/DirManage"><i class="el-icon-folder-checked">文件管理</i></el-menu-item>
          <el-menu-item index="/AddFile"><i class="el-icon-folder-add">上传文件</i></el-menu-item>



        </el-submenu>
        <el-submenu  index="2">
          <template slot="title"><i class="el-icon-star-off">文件社区</i></template>
          <el-menu-item  index="/SharePace"><i class="el-icon-s-promotion">共享广场</i></el-menu-item>

        </el-submenu>
        <el-submenu  index="3">
          <template slot="title"><i class="el-icon-user">我的信息</i></template>
            <el-menu-item  index="/UserMessage"><i class="el-icon-s-custom">编辑个人信息</i></el-menu-item>
          <el-menu-item  index="/ChangePassword"><i class="el-icon-edit">修改密码</i></el-menu-item>

        </el-submenu>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>查看</el-dropdown-item>
            <el-dropdown-item>新增</el-dropdown-item>
            <el-dropdown-item>删除</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <span :model="username">{{username}}</span>
      </el-header>
      <el-main style="height:700px">
      <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>
<style>
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}
.el-aside {
  color: #333;
}
</style>

<script>
export default {

  data(key, value) {

    const item = {
      date: '2016-05-02',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    };
    return {
      tableData: Array(20).fill(item),
      username :sessionStorage.getItem("username")
    }
  },
  created() {
    this.axios({
      url:"/user/match",
      method:"post"
    }).then((resp)=>{
      if (resp.data=='error'){
        this.$notify.error({
          title:"错误！",
          message:"请登录"
        })
        this.$router.push("/")

      }

    })

  }
};
</script>